<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
    <link rel="stylesheet" type="text/css" href="../../css/weui.min.css" />
    <link rel="stylesheet" type="text/css" href="../../css/jquery-weui.min.css" />
    <link rel="stylesheet" type="text/css" href="../../css/index.css" />
    <link rel="stylesheet" type="text/css" href="../../css/mine.css" />
    <link rel="stylesheet" type="text/css" href="https://at.alicdn.com/t/font_546019_o8qxm6fupb0ggb9.css" />
    <title>过磅单图片</title>
    <script src="../../js/jquery-2.1.4.js" type="text/javascript" charset="utf-8"></script>
    <script src="../../js/jquery-weui.min.js" type="text/javascript" charset="utf-8"></script>
    <script src="../../js/baseConfig.js" type="text/javascript" charset="utf-8"></script>
    <script src=" http://res.wx.qq.com/open/js/jweixin-1.0.0.js"></script>
</head>

<body>
    <!--<div id="header">
			<div class="header-title" style="position: fixed;top: 0;border-bottom: 0;">
				<img src="../../img/left.png" class="left" />
				<span>过磅单图片</span>
			</div>
		</div>-->
    <div class="ponderationImg" style="margin-top:0">
        <img src="../../img/squarePhoto.png" />
    </div>
    <div class="weui-gallery" style="display: none">
        <!--图片预览-->
        <span class="weui-gallery__img">
				<img src="" alt="" style="width: 100%;height: auto;margin-top: 50%">
			</span>
    </div>
</body>
<script type="text/javascript">
    $(document).ready(function() {
        baseConfig.historyBack();
        $.showLoading("加载中...");
        $.ajax({
            type: "get",
            url: baseConfig.localHttp + "weChatApi/fgclient/getPoundPic",
            async: false,
            headers: {
                'Content-Type': 'application/x-www-form-urlencoded'
            },
            data: {
                carNo: baseConfig.GetQueryString("carNo"),
                orderNo: baseConfig.GetQueryString("orderNo"),
                carId: baseConfig.GetQueryString("carId")
            },
            success: function(data) {
                $.hideLoading();
                console.log(data)
                if (data.code == 100) {
                    $(".ponderationImg img").attr("src", baseConfig.imglocalHttp + data.content)
                    $(".ponderationImg img").on("click", function() {
                        // $(".weui-gallery").show()
                        // $(".weui-gallery__img img").attr("src", baseConfig.imglocalHttp + data.content)
                        // $(".weui-gallery").on("click", function() {
                        //     $(this).hide()
                        // })
                        var imgsurl = [];
                        imgsurl[0] = this.src;
                        var nowurl = this.src;
                        wx.previewImage({
                            current: nowurl,
                            urls: imgsurl
                        });
                        // var imgsurl = [];
                        // var nowurl = '';
                        // var imgObj = $(".weui-uploader__files li .baseImg");
                        // for (var i = 0; i < imgObj.length; i++) {
                        //     imgsurl[i] = imgObj[i].src;
                        //     imgObj[i].onclick = function() {
                        //         nowurl = this.src;

                        //     }
                        // }
                    })
                } else {
                    $.toptip(data.content, 1200, 'error');
                }
            },
            error: function() {
                $.hideLoading();
                $.toast("请求失败", "cancel");
            }
        })
    })
</script>

</html>